<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <!-- 实例化的组件内不能再添加内容了 -->
    <button-btn></button-btn>
  </div>
  <script src="../vue.js"></script>
  <script>
    //全局组件注册
    Vue.component('ButtonBtn',{
      template: `
      <div>
        <button @click="tank">我是一个按钮</button>
        {{msg}}
      </div>
      `,
      data(){
        return {
          msg: 'hagese，o mei dei tuo'
        }
      },
      methods:{
        tank(){
          this.msg = '巴尔泽布小姐'
        }
      }
    })
    const app = new Vue({
      el: '#app',
      data:{},
    })
  </script>
</body>
</html>